/**
 * 
 */
package dms.service.imp;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import dms.model.Building;
import dms.model.Campus;
import dms.model.form.Bulletin;
import dms.model.util.PageIterator;
import dms.repository.BulletinRepository;
import dms.service.BulletinQueryService;

/**
 * @author 李健
 *
 */
public class BulletinQueryServiceImpl implements BulletinQueryService {

	private static final Log log = LogFactory.getLog(BuildingServiceImpl.class);
	
	private BulletinRepository bulletinRepository = null;
	
	/**
	 * @return the bulletinRepository
	 */
	public BulletinRepository getBulletinRepository() {
		return bulletinRepository;
	}

	/**
	 * @param bulletinRepository the bulletinRepository to set
	 */
	public void setBulletinRepository(BulletinRepository bulletinRepository) {
		this.bulletinRepository = bulletinRepository;
	}

	/* (non-Javadoc)
	 * @see dms.service.BulletinService#findAll(int, int, java.util.Date, java.util.Date, java.lang.String)
	 */
	@Override
	public PageIterator<Bulletin> findAll(int start, int count, Date fromDate,
			Date toDate, String query) {
		return this.bulletinRepository.findAll(start, count, fromDate, toDate, query);
	}

	/* (non-Javadoc)
	 * @see dms.service.BulletinService#findByBuilding(int, int, java.util.Date, java.util.Date, dms.model.Building, java.lang.String)
	 */
	@Override
	public PageIterator<Bulletin> findByBuilding(int start, int count,
			Date fromDate, Date toDate, Building building, String query) {
		return this.bulletinRepository.findByBuilding(start, count, fromDate, toDate, building, query);
	}

	/* (non-Javadoc)
	 * @see dms.service.BulletinService#findByBulletinId(java.lang.Long)
	 */
	@Override
	public Bulletin findByBulletinId(Long id) {
		return this.findByBulletinId(id);
	}

	/* (non-Javadoc)
	 * @see dms.service.BulletinService#findByCampus(int, int, java.util.Date, java.util.Date, dms.model.Campus, java.lang.String)
	 */
	@Override
	public PageIterator<Bulletin> findByCampus(int start, int count,
			Date fromDate, Date toDate, Campus campus, String query) {
		return this.bulletinRepository.findByCampus(start, count, fromDate, toDate, campus, query);
	}

	/**
	 * @param bulletinRepository
	 */
	public BulletinQueryServiceImpl(BulletinRepository bulletinRepository) {
		super();
		this.bulletinRepository = bulletinRepository;
	}

	/**
	 * 
	 */
	public BulletinQueryServiceImpl() {
		super();
	}

	@Override
	public Bulletin findById(Long bulletinId) {
		return this.bulletinRepository.findById(bulletinId);
	}

}
